***load Latino sample data***
use "Latino sample data.dta"

***Table 1***
probit aid treat_foreign##c.ties3 treat_lat, robust /*Model 1*/
probit aid treat_foreign##c.ties3 treat_lat age woman educ loinc white govtrust rep relimp fullemploy, robust /*Model 2*/

***Table 2***
probit aid treat_LA##c.ties3, robust /*Model 1*/
probit aid treat_LA##c.ties3 age woman educ loinc white govtrust rep relimp fullemploy, robust /*Model 2*/

***Table 3***
reg oblig treat_LA##c.ties3, robust /*Model 1*/
reg oblig treat_LA##c.ties3 age woman educ loinc white govtrust rep relimp fullemploy, robust /*Model 2*/

***Table 4***
reg close c.ties3 age woman educ loinc white govtrust rep relimp fullemploy if treat_LA==0, robust /*Africa*/
reg close c.ties3 age woman educ loinc white govtrust rep relimp fullemploy if treat_LA==1, robust /*Latin America*/

***Table 5***
set more off
#delimit ;
medeff (regress close ties3 age woman educ loinc white govtrust rep relimp fullemploy)
(probit aid close ties3 age woman educ loinc white govtrust rep relimp fullemploy) if treat_LA==1,
mediate(close) treat(ties3) sims(1500) seed(5) vce(robust);

probit aid ties3 age woman educ loinc white govtrust rep relimp fullemploy if treat_LA==1 /*Model 2*/



***Figure 4***
set more off
#delimit ;
probit aid treat_foreign##c.ties3 treat_lat age woman educ loinc white govtrust rep relimp fullemploy
govtrust rep relimp fullemploy, robust;
margins treat_foreign, at(ties3=(0(1)2)) asbalanced;
marginsplot, x(ties3) 
plot1opts(mcolor(gs10) lcolor(gs10))
plot2opts(mcolor(black) lcolor(black))
ci1opts(recast(rspike) lcolor(gs10)) 
ci2opts(recast(rspike) lcolor(black)) 
graphregion(fcolor(white) lcolor(white))
plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
title("", color(black))
ytitle("Pr(Aid Support)", size(small))
ylabel(.4(.1)1, labsize(small) glcolor(white) angle(vertical))
xlabel(,valuelabel labsize(normal) glcolor(white) angle(horizontal)) 
xscale(range(-.5 2.5))
xtitle("")
note("Note: 95% CI Reported", size(vsmall));
#delimit cr; 

***Figure 5***
set more off
#delimit ;
probit aid treat_LA##c.ties3 age woman educ loinc white govtrust rep relimp fullemploy
govtrust rep relimp fullemploy, robust;
margins treat_LA, at(ties3=(0(1)2)) asbalanced;
marginsplot, x(ties3) 
plot1opts(mcolor(gs10) lcolor(gs10))
plot2opts(mcolor(black) lcolor(black))
ci1opts(recast(rspike) lcolor(gs10)) 
ci2opts(recast(rspike) lcolor(black)) 
graphregion(fcolor(white) lcolor(white))
plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
title("", color(black))
ytitle("Pr(Foreign Aid Support)", size(small))
ylabel(.4(.1)1, labsize(small) glcolor(white) angle(vertical))
xlabel(,valuelabel labsize(normal) glcolor(white) angle(horizontal)) 
xscale(range(-.5 2.5))
xtitle("")
note("Note: 95% CI Reported", size(vsmall));
#delimit cr; 

***Figure 6***
set more off
#delimit ;
reg oblig treat_LA##c.ties3 age woman educ loinc white govtrust rep relimp fullemploy
govtrust rep relimp fullemploy, robust;
margins treat_LA, at(ties3=(0(1)2)) asbalanced;
marginsplot, x(ties3) 
plot1opts(mcolor(gs7) lcolor(gs7))
plot2opts(mcolor(black) lcolor(black))
ci1opts(recast(rspike) lcolor(gs7)) 
ci2opts(recast(rspike) lcolor(black)) 
graphregion(fcolor(white) lcolor(white))
plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
title("", color(black))
ytitle("Linear Prediction of Morality", size(small))
ylabel(, labsize(small) glcolor(white) angle(vertical))
xlabel(,valuelabel labsize(normal) glcolor(white) angle(horizontal)) 
xscale(range(-.5 1.5))
xtitle("")
note("Note: 95% CI Reported", size(vsmall));
#delimit cr; 


/*White samples*/

***Table 6***
*load U.S. representative sample data
use "U.S. representative sample data.dta"

tab race3 ties3, row all /*White, Black, and Latino*/
tab ties3 if race3==. /*All other groups*/


*load UK representative sample data
use "UK representative sample data.dta"
tab white ties3, row all


***Table 7***

*load U.S. representative sample data
use "U.S. representative sample data.dta"

probit aid c.ties3 treat_black treat_cash age gender educ loinc relimp fullemploy lib if race3==1 /*US White*/
probit aid c.ties3 treat_black treat_cash age gender educ loinc relimp fullemploy lib if race3==2 /*US Black*/
probit aid c.ties3 treat_black treat_cash age gender educ loinc relimp fullemploy lib if race3==3 /*US Latino*/
probit aid c.ties3 treat_black treat_cash age gender educ loinc relimp fullemploy lib if race3==. /*US Other Groups*/

*load UK representative sample data
use "UK representative sample data.dta"

probit foraid c.ties3 age woman college relimp employ labour treat_black1 treat_cash1 if white==1, robust /*UK White*/
probit foraid c.ties3 age woman college relimp employ labour treat_black1 treat_cash1 if white==0, robust /*UK Non-white*/

***Figure 7***

*load U.S. representative sample data
use "U.S. representative sample data.dta"

set more off
#delimit ;
probit aid treat_black##c.ties3 age gender educ loinc relimp fullemploy lib if race3==1, robust;
margins treat_black, at(ties3=(0(1)2)) asbalanced;
marginsplot, x(ties3) 
plot1opts(mcolor(gs10) lcolor(gs10))
plot2opts(mcolor(black) lcolor(black))
ci1opts(recast(rspike) lcolor(gs10)) 
ci2opts(recast(rspike) lcolor(black)) 
graphregion(fcolor(white) lcolor(white))
plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
title("", color(black))
subtitle("", color(black))
ytitle("Pr(Foreign Aid Support)", size(small))
ylabel(, labsize(small) glcolor(white) angle(vertical))
xlabel(,valuelabel labsize(normal) glcolor(white) angle(horizontal)) 
xscale(range(-.5 2.5))
xtitle("")
note("Note: 95% CI reported", size(vsmall));
#delimit cr; 


***Figure 8***

*load UK representative sample data
use "UK representative sample data.dta"

set more off
#delimit ;
probit foraid c.ties3##treat_black1 age woman college relimp employ labour treat_cash1 if white==1, robust;
margins treat_black1, at(ties3=(0(1)2)) asbalanced;
marginsplot, x(ties3) 
plot1opts(mcolor(gs10) lcolor(gs10))
plot2opts(mcolor(black) lcolor(black))
ci1opts(recast(rspike) lcolor(gs10)) 
ci2opts(recast(rspike) lcolor(black)) 
graphregion(fcolor(white) lcolor(white))
plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
title("", color(black))
subtitle("", color(black))
ytitle("Pr(Foreign Aid Support)", size(small))
ylabel(, labsize(small) glcolor(white) angle(vertical))
xlabel(,valuelabel labsize(normal) glcolor(white) angle(horizontal)) 
xscale(range(-.5 2.5))
xtitle("")
note("Note: 95% CI reported", size(vsmall));
#delimit cr; 























